import { List, Radio, RadioChangeEvent } from 'antd'
import Title from 'antd/lib/typography/Title'
import React from 'react'
import prices from '../../helpers/price'
interface Props {
  handleFilter: (args: number[]) => void
}
const Radiobox = ({handleFilter}:Props) => {
  const data = [{price:'0-50'},{price:'50-100'}]
  const onChange = (event: RadioChangeEvent)=> {
    handleFilter(event.target.value)
  }
  return (
    <>
      <Title level={4}>
        按照价格
      </Title>
      <Radio.Group>
        <List dataSource={prices} renderItem={item=>(
          <List.Item>
            <Radio value={item.array}
              onChange={onChange}
            >{item.name}</Radio>
          </List.Item>
        )} />     
      </Radio.Group>
    </>
  )
}
export default Radiobox